package org.yefei.homeworkday16.carrentsysem;

//汽车类
public abstract class Car {
	private String brand;
	private String cNum;// 车牌号
	private double dateRent;// 日租金
	private boolean state;// 当前状态
	private int seating;
	private String type;

	public Car() {
	}

	public Car(String brand, String cNum, double dateRent, boolean state, int seating, String type) {
		this.brand = brand;
		this.cNum = cNum;
		this.dateRent = dateRent;
		this.state = state;
		this.seating = seating;
		this.type = type;
	}

	public String getBrand() {
		return brand;
	}

	public void setBrand(String brand) {
		this.brand = brand;
	}

	public String getcNum() {
		return cNum;
	}

	public void setcNum(String cNum) {
		this.cNum = cNum;
	}

	public double getDateRent() {
		return dateRent;
	}

	public void setDateRent(double dateRent) {
		if (dateRent < 100) {
			System.err.println("日租金不小于100！");
			dateRent = 100;
		}
		this.dateRent = dateRent;
	}

	public boolean getState() {
		return state;
	}

	public void setState(boolean state) {
		this.state = state;
	}

	public double getSeating() {
		return seating;
	}

	public void setSeating(int seating) {
		if (seating <= 0) {
			System.err.println("座位数不小于0！");
			seating = 4;
		}
		this.seating = seating;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public void showCar() {
		System.out.println(brand + "  \t" + cNum + "  \t\t" + dateRent + "  \t\t" + (state == true ? "当前可用" : "当前不可用")
				+ "  \t" + seating + "  \t" + type);
	}

	@Override
	public String toString() {

		return "恭喜您租车成功，您租的车辆为：" + brand + "，车牌号为 ：" + cNum;
	}

	public abstract double calDateRent(int day);
}
